package com.alan.demo;

import com.alan.demo.base.IPageInfo;
import com.alan.demo.service.QaRecordService;
import com.alan.demo.utilt.sql.SqlUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.List;

@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(DemoApplication.class, args);
        QaRecordService recordService = context.getBean(QaRecordService.class);

        SqlUtils.open(() -> recordService.page(new IPageInfo<>()));

        SqlUtils.open();
        recordService.getById(0);

        List<String> sqlList = SqlUtils.getSqlList();

        System.out.println();
        System.out.println();
        System.out.println();
        for (String sql : sqlList) {
            System.out.println(sql);
            System.out.println();
        }
        System.out.println();
        System.out.println();
        System.out.println();

    }
}
